import Vue from 'vue'
Vue.filter("typeFormat", (status) => {
	switch (status) {
		case 0:
			return "失败";
			break;
		case 1:
			return "成功";
			break;
		case true:
			return '成功';
			break;
		case false:
			return '失败';
			break;
			return;
	}
})
Vue.filter("statusFormat", (status) => {
	switch (status) {
		case 1:
			return "播放（抖音）";
			break;
		case 2:
			return "转发（抖音）";
			break;
		case 3:
			return "点赞（抖音）";
			break;
		case 4:
			return "关注（抖音）";
			break;
		case 5:
			return "评论（抖音）";
			break;
		case 6:
			return "混合人气（抖音）";
			break;
		case 7:
			return "上榜人气（抖音）";
			break;
		case 8:
			return "真机人气（抖音）";
			break;
			return;
		case 15:
			return "直播包时发言（抖音）";
			break;
			return;
		case 16:
			return "直播间点赞（抖音）";
			break;
			return;
		case 17:
			return "直播间小黄车（抖音）";
			break;
			return;
		case 18:
			return "直播间礼物（抖音）";
			break;
			return;
		case 19:
			return "直播间粉丝团（抖音）";
			break;
			return;
		case 23:
			return "播放（快手）";
			break;
			return;
		case 24:
			return "转发（快手）";
			break;
			return;
		case 25:
			return "点赞（快手）";
			break;
			return;
		case 26:
			return "关注（快手）";
			break;
			return;
		case 27:
			return "评论（快手）";
			break;
			return;
		case 28:
			return "上榜人气（快手）";
			break;
			return;
		case 29:
			return "直播间包时发言（快手）";
			break;
			return;
		case 30:
			return "直播间点赞（快手）";
			break;
			return;
		case 31:
			return "直播间单次发言（快手）";
			break;
			return;
	}
})

Vue.filter('actualName', (value) => {
	switch (value) {
		case "bofang":
			return "播放（抖音）";
			break;
		case "fenxiang":
			return "转发（抖音）";
			break;
		case "dianzan":
			return "点赞（抖音）";
			break;
		case "guanzhu":
			return "关注（抖音）";
			break;
		case "pinglun":
			return "评论（抖音）";
			break;
		case "putongzhibo":
			return "混合人气（抖音）";
			break;
		case "zhiboshangbang":
			return "上榜人气（抖音）";
			break;
		case "zhengjirenqi":
			return "真机人气（抖音）";
			break;
		case "akzhibojiandianzan":
			return "直播间点赞（快手）";
			break;
		case "akzhibojiangunping":
			return "直播间单次发言（快手）";
			break;
		case "azhibojianfayan":
			return "直播间包时发言（快手）";
			break;
		case "zhibojianfayan":
			return "播放（快手）";
			break;
		case "zhibojiandianzan":
			return "转发（快手）";
			break;
		case "zhibojiangunping":
			return "点赞（快手）";
			break;
		case "kbofang":
			return "直播包时发言（抖音）";
			break;
		case 'kfenxiang':
			return "直播间点赞（抖音）";
			break;
		case 'kdianzan':
			return "直播间小黄车（抖音）";
			break;
		case 'kguanzhu':
			return "直播间礼物（抖音）";
			break;
		case "zhibojiangunping":
			return "点赞（快手）";
			break;
		case "zhibojiangunping":
			return "点赞（快手）";
			break;
		case "kzhibojiangunping":
			return "上榜人气（快手）";
			break;
		case "kzhibojiandianzan":
			return "评论（快手）";
			break;
		case "kzhibojianfayan":
			return "关注（快手）";
			break;
        case 'kpinglun':
            return "直播间粉丝团（抖音）";
            break;
	}
})


Vue.filter("number", function(data) {
	return Number(data).toFixed(2)
	// return parseFloat(data).toFixed(2)
	// var toFixedNum = Number(data).toFixed(3);
	// var realVal = toFixedNum.substring(0, toFixedNum.toString().length - 1);
	// return realVal;
})


Vue.filter("dashadiao", (xiaoshadiao) => {
	return xiaoshadiao.replace("T", "   ");
})



Vue.filter('dadashadiao', function (text, length) {
  return text.substring(0, 21);
})


Vue.filter("type", (sta) => {
	switch (sta) {
		case 0:
			return "提现中";
			break;
		case 1:
			return "已提现";
			break;
		case true:
			return '已提现';
			break;
		case false:
			return '提现中';
			break;
			return;
	}
})
